<?php
// 这是系统自动生成的公共文件
/**
 * 运算
 */
function jisuan($num1,$num2,$opt,$length){
    switch($opt){
        case "+":
            $rs=bcadd("$num1","$num2",$length);
            break;
        case "-":
            $rs=bcsub("$num1","$num2",$length);
            break;
        case "*":
            $rs=bcmul("$num1","$num2",$length);
            break;
        case "/":
            if($num2==0){
                exit("被除数不能为0！");
            }else{
                $rs=bcdiv("$num1","$num2",$length);
            }
            break;
        default:
            echo "异常操作！";
            break;
    }
    return $rs;

}